<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>PDF批量转换工具</title>
    <style>
        body { font-family: Arial, sans-serif; margin: 40px; }
        .container { max-width: 600px; margin: auto; }
        h2 { color: #2c3e50; }
        .files { margin-top: 30px; }
        .files ul { list-style: none; padding: 0; }
        .files li { margin-bottom: 8px; }
    </style>
</head>
<body>
<div class="container">
    <h2>PDF批量转换为Markdown和Word</h2>
    <form method="post" enctype="multipart/form-data">
        <input type="file" name="pdfs" multiple accept="application/pdf">
        <button type="submit">上传并转换</button>
    </form>
    <form method="get" action="{{ url_for('download_all') }}" style="margin-top:20px;">
        <button type="submit">批量下载所有转换文件（zip）</button>
    </form>
    <div class="files">
        <h3>已转换Markdown文件</h3>
        <ul>
            {% for file in md_files %}
            <li><a href="{{ url_for('download_md', filename=file) }}">{{ file }}</a></li>
            {% endfor %}
        </ul>
        <h3>已转换Word文件</h3>
        <ul>
            {% for file in docx_files %}
            <li><a href="{{ url_for('download_docx', filename=file) }}">{{ file }}</a></li>
            {% endfor %}
        </ul>
    </div>
</div>
</body>
</html>
